<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">
	   	<title>申请提现</title>
	    <link href="/static/weike/css/style.css" rel="stylesheet">
	    <script src="/static/weike/js/style.js"></script>
	    <script src="/static/weike/js/pic_deal.js"></script>
	    <script src="/static/js/jquery.js"></script>
	    <script src="/static/lrz/dist/lrz.bundle.js"></script>
	</head>
	<body class="weike_reflect">
		<header>
			<p>您当前可提现金额</p>
			<div><a id="profit" style="text-decoration: none; color:#666;">{$person['profit']|money_profit}</a><span>元</span></div>
		</header>
		<article>
			<p>提现金额</p>
			<div>￥<input id="money" type="text" onkeyup="value=value.replace(/[^\d\.]/g,'')" class="money" value="" /></div>
			<p>请上传您的微信收款二维码</p>
			<article class="article">
				<div class="input_file">
					<section class="show">
						<input type="file" name="0" accept="image/*" />
						<input type="hidden" id="col_qrcode" />
						<canvas class="input_canvas"></canvas>
						<img src="/static/weike/img/weike_reflect.png" class="press" />
						<div class="close"><span></span></div>
					</section>
				</div>
			</article>
		</article>
		<footer>
			<p>审核状态会尽快发消息通知您</p>
			<div>
				<button onclick="javascript:window.location.href='http://mg.bonayiyou.com/index/home/weike_center.html'">取消提现</button>
				<button  class="reflect" onclick="tixian()">申请提现</button>
			</div>
		</footer>
		<script type="text/javascript">
		function tixian()
		{
        if(parseFloat($("#profit").text())<parseFloat($("#money").val())||$("#profit").text()==0)
        {
        	alert('提现金额超过您你的收益金额');
            exit(0);
        }	
        var data={};
        var url="http://mg.bonayiyou.com/index/home/weike_reflect";
        data['money']=$("#money").val();
        data['col_qrcode']=$("#col_qrcode").val();
        $.post(url,data,function(e)
        {
        if(e.code==-1)
        {
        	alert('操作失败请重新操作');
        }
        else
        {
        	window.location.href="http://mg.bonayiyou.com/index/home/register_chosuc.html";
        }
        },"JSON");

		}
		//移动端上传图片
	    $("input[type=file]").change(function () {
	    	var next_input=$(this).next();
	        /* 压缩图片 */
	        lrz(this.files[0], {
	            width: 300 //设置压缩参数
	        }).then(function (rst) {
	            /* 处理成功后执行 */
	            rst.formData.append('base64img', rst.base64); // 添加额外参数
	            $.ajax({
	                url: "/index/home/post_img",
	                type: "POST",
	                data: rst.formData,
	                processData: false,
	                contentType: false,
	                success: function (data) {
	                   next_input.attr('value',data);
	                }
	            });
	        }).catch(function (err) {
	            /* 处理失败后执行 */
	        }).always(function () {
	            /* 必然执行 */
	        })
    })
		</script>
	</body>
</html>
